/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.manager;

import br.com.foxline.model.ActCep;
import br.com.foxline.model.TypeStamp;
import br.com.foxline.service.ActCepService;
import br.com.foxline.service.TypeStampService;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author roniere
 */
@ManagedBean
@ViewScoped
public class ManagerTypeStamp implements Serializable{
    
    @EJB
    TypeStampService typeStampService;
    
    private TypeStamp typeStamp;
    
    @PostConstruct
    public void init(){
        typeStamp = new TypeStamp();
    }

    public TypeStamp getTypeStamp() {
        return typeStamp;
    }

    public void setTypeStamp(TypeStamp typeStamp) {
        this.typeStamp = typeStamp;
    }
    
    
    
    public List<TypeStamp> autoComplete(String query){
        return typeStampService.autoComplete(query);
    }
    
    public void create(){
        typeStampService.saveStamp(typeStamp);
        typeStamp = new TypeStamp();
    }
}
